<!-- 优享专区商品详情 -->
<template>
	<view class="container">
		<uni-nav-bar leftIcon="back" @clickLeft="back" statusBar="true" custom="true" fixed="true" :color="navColor"
		 :background="navBg" title="产品详情">

		</uni-nav-bar>
		<!-- #ifdef MP-WEIXIN -->
		<view class="goBack" v-show="backIconShow" :style="{top: fixedTop + 'px'}" @tap="back">
			<text class="yticon icon-zuo"></text>
		</view>
		<!-- #endif -->
		<!-- #ifdef APP-PLUS -->
		<view class="navigation" v-show="backIconShow">
			<view class="back" @tap="back">
				<text class="yticon icon-zuo"></text>
			</view>
			<view class="right">
				<view class="a" @tap="share">
					<image src="../static/images/acd321.png" mode="widthFix"></image>
				</view>
				<view class="a b" @tap="navTo('/pages/index/index')">
					<image src="../static/images/acd123.png" mode="widthFix"></image>
				</view>
			</view>
		</view>
		<!-- #endif -->

		<view class="carousel">
			<swiper indicator-dots circular=true duration="400">
				<block v-for="(item,index) in storeInfo.slider_image" :key="index">
					<swiper-item class="swiper-item">
						<view class="image-wrapper">
							<easy-loadimage mode="widthFix" :scroll-top="scrollTop" :image-src="item"></easy-loadimage>
						</view>
					</swiper-item>
				</block>
			</swiper>
		</view>

		<view class="introduce-section">
			<view class="pd-30">
				<view class="titleBox">
					<view class="title" v-if="seller_info">
						<text v-if="seller_info.seller_type == 2">自营</text>
						{{storeInfo.store_name}}
					</view>
					<!-- <view class="collect" @click="toFavorite">
						<image lazy-load :src="storeInfo.userCollect?'../static/images/collect-icon.png':'/static/images/mall/collect.png'"
						 mode=""></image>
						<text>{{storeInfo.userCollect?'已收藏':'收藏'}}</text>
					</view> -->
				</view>
				<view class="black_rate">购买可获得<text>{{blackS}}</text>黑贝壳</view>
				<view class="price-box">
					<text class="price-tip">¥</text>
					<text class="price">{{selectDisObj.priceF}}</text>
					<text class="pricePoint">{{selectDisObj.priceE}}</text>
					<view class="vip-price">
						<text class="v-price-tip">￥</text>
						<text class="v-price">{{selectDisObj.price1F}}</text>
						<text class="v-price v-pricePoint">{{selectDisObj.price1E}}</text>
						<text class="v-icon">k1</text>
					</view>
					<view class="vip-price">
						<text class="v-price-tip">￥</text>
						<text class="v-price">{{selectDisObj.price2F}}</text>
						<text class="v-price v-pricePoint">{{selectDisObj.price2E}}</text>
						<text class="v-icon k2">k2</text>
					</view>
					<!-- <text class="m-price">¥{{storeInfo.ot_price}}</text> -->
					<!-- <text class="coupon-tip" v-show="parseInt(Number(storeInfo.price)/Number(storeInfo.ot_price)*10)!=10">{{parseInt(Number(storeInfo.price)/Number(storeInfo.ot_price)*10)}}折</text> -->
				</view>
				<view class="bot-row">
					<text>销量: {{storeInfo.ficti + storeInfo.sales}}</text>
					<text>库存: {{storeInfo.stock}}</text>
					<text v-if="!storeInfo.is_postage">运费: {{storeInfo.postage}}</text>
					<text v-else>运费: 免运费</text>
					<text>浏览量: {{storeInfo.browse}}</text>
				</view>
			</view>

			<view class="c-list">
				<view class="c-row b-b" v-if="!userInfo||userInfo.level != 2" @tap="navTo('/pages/center/vip/vipRight')">
					<text class="v-icon">k2</text>
					<text class="con">开通K2能省 {{ Number(selectDisObj.price2) == 0 ? 0 : (Number(selectDisObj.price) - Number(selectDisObj.price2)).toFixed(2)}}(元)</text>
					<text class="yticon icon-you"></text>
				</view>
				<view class="c-row b-b" v-else-if="userInfo&&userInfo.level == 2">
					<text class="v-icon">k2</text>
					<text class="con">您已是k2会员，能省 {{ Number(selectDisObj.price2) == 0 ? 0 : (Number(selectDisObj.price) - Number(selectDisObj.price2)).toFixed(2)}}(元)</text>
				</view>
			</view>
		</view>
		<view class="cut"></view>
		<view class="c-list">
			<view class="c-row" @click="toggleSpec(3)">
				<text class="tit">购买类型</text>
				<view class="con">
					<text class="selected-text">{{selectDisObj.suk}}</text>
				</view>
				<text class="yticon icon-you"></text>
			</view>
			<view class="c-row b-b" @click="toggleMask('show')">
				<text class="tit">优惠券</text>
				<text class="con t-r red" v-if="couponsList.length > 0">领取优惠券</text>
				<text class="con t-r" v-else>暂无优惠券</text>
				<text class="yticon icon-you"></text>
			</view>
		</view>
		<view class="cut"></view>
		<!-- 评价 -->
		<view class="eva-section">
			<view class="e-header" @tap="navTo('/mall/product/comments?goodsId='+data.storeInfo.id)">
				<text class="tit">评价</text>
				<text class="descc">({{data.replyCount}})</text>
				<text class="desc tip">查看全部评论</text>
				<text class="yticon icon-you"></text>
			</view>
			<view class="eva-box" v-if="data.replyCount > 0&&reply">
				<image lazy-load class="portrait" :src="reply.avatar"></image>
				<view class="right">
					<text class="name">{{reply.nickname}}</text>
					<text class="con">{{reply.comment}}</text>
					<view class="comment-pics">
						<image @tap.stop="previewPic(reply.pics,index)" v-for="(item,index) in reply.pics" :key="index" :src="item" mode="aspectFill"></image>
					</view>
					<view class="bot">
						<text class="attr" v-if="reply.suk">购买类型：{{reply.suk || ''}}</text>
						<text class="attr" v-else></text>
						<text class="time">{{reply.add_time}}</text>
					</view>
				</view>
			</view>
		</view>
		<view class="cut"></view>
		<!-- <view class="shop" @tap="toOnlineStore" v-if="seller_info.online_name">
			<view class="shopInfo">
				<image lazy-load :src="seller_info.online_logo" mode=""></image>
				<view class="infoBox">
					<view class="title clamp">
						<text class="icon">自营</text>
						{{seller_info.online_name}}
					</view>
					<view class="info__rate">
						<uni-rate class="rate" active="white" normal="white" bgSeleColor="#E65431" bgNoSeleColor="grey" :isIndexRate="true"
						 :size="16" :current="seller_score" disabled></uni-rate>
						<text class="score">{{seller_info.online_product_average_score}}</text>
						<text class="conclusion">{{seller_info.collect_num}}人收藏</text>
					</view>

				</view>
			</view>
			<view class="goto">
				<text class="cell-more yticon icon-you"></text>
			</view>
			<view class="goodsList">
				<view class="item" v-for="(item,index) in seller_info.goods_list" :key="index" @tap.stop="navTo('/mall/product/product?id=' + item.id)">
					<image :src="item.image" mode=""></image>
					<text class="clamp2">{{item.store_name}}</text>
				</view>
			</view>
			<view class="seeMore">
				<text>查看更多</text>
			</view>
		</view> -->
		<view class="cut"></view>
		<view class="detail-desc">
			<view class="d-header">
				<text class="txt">商品详情</text>
			</view>
			<rich-text class="rich-text" :nodes="description"></rich-text>
			<!-- <view class="d-footer">
				<text class="text">已经到底啦</text>
			</view> -->
		</view>
		<!-- <view class="goodslist">
			<view class="goodslistTitle">相似产品推荐</view>
			<view class="goodslistBox">
				<goods-block :goodsList="similarGoodsList" :scrollTop="scrollTop"></goods-block>
			</view>
			<uni-load-more class="loadMore" iconType="circle" :status="loadStatus" :contentText="contentText"></uni-load-more>
		</view> -->
		<!-- 底部操作菜单 -->
		<view class="page-bottom">
			<view class="left">
				<view @tap="callStore" class="p-b-btn">
					<image lazy-load src="/static/images/mall/hotline.png" mode=""></image>
					<text>客服热线</text>
				</view>
				<!-- <navigator url="/mall/index/indexPage?current=2" class="p-b-btn">
					<image lazy-load src="/static/images/mall/mall-cart.png" mode=""></image>
					<text>购物车</text>
				</navigator> -->
			</view>

			<view class="action-btn-group">
				<!-- <view class="action-btn no-border add-cart-btn" @click="toggleSpec(2)">加入购物车</view> -->
				<view class="action-btn no-border buy-now-btn" @tap="toggleSpec(1)">立即购买</view>
			</view>
		</view>

		<!-- 优惠券面板 -->
		<view class="mask" :class="maskState===0 ? 'none' : maskState===1 ? 'show' : ''" @click="toggleMask">
			<view class="mask-content" @click.stop.prevent="stopPrevent">
				<block v-for="(item,index) in couponsList" :key="index">
					<view class="coupon-item" @click="getCoupons(item)">
						<view class="con">
							<view class="left">
								<text class="title">{{item.coupon_title}}</text>
								<text v-if="item.end_time" class="time">有效期至{{item.end_time}}</text>
								<text v-else class="time">永久有效</text>
							</view>
							<view class="right">
								<text class="price">{{item.coupon_price}}</text>
								<text>满{{item.use_min_price}}可用</text>
							</view>
							<view class="circle l"></view>
							<view class="circle r"></view>
						</view>
						<text class="tips">限新用户使用</text>
					</view>
				</block>
			</view>
		</view>
		<view class="backTop" v-if="flag" @tap="backTop">
			<image src="../static/images/backUp.png" mode="widthFix"></image>
			<text>顶部</text>
		</view>
		<!-- 规格-模态层弹窗 -->
		<view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
			<!-- 遮罩层 -->
			<view class="mask"></view>
			<view class="layer attr-content" @click.stop="stopPrevent">
				<view>
					<view class="a-t">
						<image lazy-load :src="selectDisObj.image"></image>
						<view class="right">
							<text class="price">{{selectDisObj.price}}</text>
							<text class="stock">库存：{{selectDisObj.stock}}件</text>
							<view class="selected" v-if="selectDisObj.suk">
								已选：{{selectDisObj.suk}}
							</view>
						</view>
					</view>
					<view class="a-c">
						<view class="attr-list">
							<block v-for="(items, index) in specList" :key="index">
								<text class="specTitle">{{items.attr_name}}</text>
								<view class="itemBox">
									<view @tap='selectSpec(item,index,idx)' :class="subIndex[index] == idx ?'itemAct':''" class="item" v-for="(item,idx) in items.attr_value"
									 :key="idx">{{item.attr}}</view>
								</view>
							</block>
						</view>
						<!-- :max="item.productInfo.attrInfo.stock" -->
					</view>
					<view class="num">
						<text>数量</text>
						<uni-number-box class="uni-number-box" :min="1" :value="goodsNum" @eventChange="numberChange"></uni-number-box>
					</view>
					<view class="btn-box">
						<button class="btn" @click="submit">{{btnType == 1 ? '立即购买' : '确认'}}</button>
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue'
	import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue"
	import uniLoadMore from "../../components/uni-load-more/uni-load-more.vue"
	import goodsBlock from "@/components/goodsBlock/goodsBlock.vue"
	import {
		systemConfig
	} from '@/api/public.js'
	import {
		shareBaseUrl
	} from "@/api/api.js"
	import {
		productDetail,
		collectDel,
		collectAdd,
		cartCount,
		cartAdd,
		orderCreate,
		userInfo,
		similarGoods,
		// couponsList
		// orderConfirm
	} from '@/api/mall.js'
	import {
		formatRichText
	} from '@/utils/util.js'
	export default {
		components: {
			uniNumberBox,
			uniNavBar,
			uniLoadMore,
			goodsBlock
		},
		data() {
			return {
				userInfo: {},
				flag: false,
				id: '',
				backIconShow: true,
				// #ifdef MP-WEIXIN
				fixedTop: getApp().globalData.MenuButtonTop,
				// #endif
				navColor: 'rgba(0,0,0,0)',
				navBg: "inherit",
				storeInfo: {}, //商品信息
				specClass: 'none',
				favorite: true,
				shareList: [],
				slider_image: [],
				specList: [],
				selectArr: [],
				selectDisObj: {
					price: 0,
				},
				unique: null,
				btnType: 0,
				mapKey: null,
				description: '',
				goodsNum: 1,
				maskState: 0,
				seller_info: {
					online_name: ''
				},
				seller_score: 0,
				reply: {},
				data: {
					rebate_ratio: 0,
				},
				personal_shell_ration: 1,
				sku: '',
				subIndex: [],
				couponsList: [],
				goodsPrice: 0,
				loadStatus: "loading",
				contentText: {
					contentdown: "上拉显示更多",
					contentrefresh: "正在加载...",
					contentnomore: "没有更多了"
				},
				page: 1,
				limit: 10,
				shareBaseUrl: "",
				similarGoodsList: [],
				scrollTop:0
			};
		},
		computed: {
			blackS() {
				let blackS = (Number(this.selectDisObj.price) * ((100 - this.data.rebate_ratio) * this.personal_shell_ration) / 100)
					.toFixed(2)
				return blackS
			}
		},
		onLoad(options) {
			this.shareBaseUrl = shareBaseUrl()
			systemConfig({
				filed: 'personal_shell_ration'
			}).then(res => {
				this.personal_shell_ration = Number(res.msg) / 100
			})
			this.userInfo = uni.getStorageSync("userInfo")
			this.id = options.id
			productDetail(options.id).then(res => {
				this.data = res.data
				this.seller_info = res.data.seller_info
				this.seller_score = Number(Number(this.seller_info.online_product_average_score).toFixed(0))
				this.storeInfo = res.data.storeInfo
				this.mapKey = res.data.mapKey
				this.reply = res.data.reply
				this.slider_image = res.data.storeInfo.slider_image
				if (res.data.productAttr.length !== 0) {
					this.specList = res.data.productAttr
				}
				this.goodsPrice = res.data.storeInfo.price
				this.selectDisObj = res.data.storeInfo
				this.selectDisObj.priceF = (this.selectDisObj.price).substr(0, (this.selectDisObj.price).length - 2)
				this.selectDisObj.priceE = (this.selectDisObj.price).substr((this.selectDisObj.price).length - 2)
				this.selectDisObj.price1F = (this.selectDisObj.price1).substr(0, (this.selectDisObj.price1).length - 2)
				this.selectDisObj.price1E = (this.selectDisObj.price1).substr((this.selectDisObj.price1).length - 2)
				this.selectDisObj.price2F = (this.selectDisObj.price2).substr(0, (this.selectDisObj.price2).length - 2)
				this.selectDisObj.price2E = (this.selectDisObj.price2).substr((this.selectDisObj.price2).length - 2)
				this.description = formatRichText(res.data.storeInfo.description)
			})
			this.getSimilarGoods()
		},
		onReachBottom() {
			if (this.loadStatus == "more")
				(this.loadStatus = "loading"), this.getSimilarGoods();
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop
			this.navBg = "rgba(255,255,255," + e.scrollTop / 150 + ')'
			if (e.scrollTop > 10) {
				this.backIconShow = false
				this.navColor = '#333'
			} else {
				this.backIconShow = true
				this.navColor = 'rgba(0,0,0,0)'
			}
			if (e.scrollTop > 600) { //当距离大于600时显示回到顶部按钮
				this.flag = true
			} else { //当距离小于600时隐藏回到顶部按钮
				this.flag = false
			}
		},
		methods: {
			// 分享
			share() {
				let pages = getCurrentPages();
				let page = (pages[pages.length - 1]).route;
				let shareHref = this.shareBaseUrl + page + "?id=" + this.id
				uni.share({
				    provider: 'weixin',
				    scene: "WXSceneSession",
				    type: 0,
				    imageUrl: this.storeInfo.image,
				    title: this.storeInfo.store_name,
					href: shareHref,
				    success: ret => {
				        console.log(JSON.stringify(ret));
				    }
				});
			},
			backTop() {
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 300
				});
			},
			getSimilarGoods() {
				similarGoods({
					page: this.page,
					limit: this.limit,
					productId: this.id
				}).then(res => {
					this.loadStatus = "more";
					let list = res.data.goods_list.map((val, key) => {
						val.blackS = (Number(val.price) * ((100 - val.rebate_ratio) * this.personal_shell_ration) / 100).toFixed(2);
						return val;
					})
					this.similarGoodsList.push.apply(this.similarGoodsList, list);
					if (list.length < this.limit) this.loadStatus = "noMore"; //判断所有数据是否加载完成；
					this.page = this.page + 1;
					if (this.similarGoodsList.length == 0) {
						this.nodata = true
						this.contentText.contentnomore = ''
					} else {
						this.nodata = false
					}
				})
			},
			back() {
				uni.navigateBack({

				})
			},
			navTo(url) {
				uni.navigateTo({
					url: url
				})
			},
			numberChange(e) {
				this.goodsNum = e.number;
			},
			//显示优惠券面板
			toggleMask(type) {
				uni.showToast({
					icon: 'none',
					title: '小普正在开发中，新功能即将上线'
				})
				// let timer = type === 'show' ? 10 : 300;
				// let state = type === 'show' ? 1 : 0;
				// this.maskState = 2;
				// setTimeout(() => {
				// 	this.maskState = state;
				// }, timer)
			},
			//规格弹窗开关
			toggleSpec(type) {
				this.btnType = type
				if (this.specClass === 'show') {
					this.specClass = 'hide'
				} else if (this.specClass === 'hide' || this.specClass === 'none') {
					this.specClass = 'show'
				}
			},
			//选择规格
			selectSpec(item, index, idx) {
				if (this.selectArr[index] !== item.attr) {
					this.$set(this.selectArr, index, item.attr)
					this.$set(this.subIndex, index, idx)
					this.sku = String(this.selectArr)
					if (this.data.productValue[this.sku]) {
						this.selectDisObj = this.data.productValue[this.sku]
						this.selectDisObj.priceF = (this.selectDisObj.price).substr(0, (this.selectDisObj.price).length - 2)
						this.selectDisObj.priceE = (this.selectDisObj.price).substr((this.selectDisObj.price).length - 2)
						this.selectDisObj.price1F = (this.selectDisObj.price1).substr(0, (this.selectDisObj.price1).length - 2)
						this.selectDisObj.price1E = (this.selectDisObj.price1).substr((this.selectDisObj.price1).length - 2)
						this.selectDisObj.price2F = (this.selectDisObj.price2).substr(0, (this.selectDisObj.price2).length - 2)
						this.selectDisObj.price2E = (this.selectDisObj.price2).substr((this.selectDisObj.price2).length - 2)
					}

				}
			},
			//收藏
			toFavorite() {
				if (this.storeInfo.userCollect) {
					collectDel({
						id: this.storeInfo.id,
						// category: //产品类型|product=普通产品,product_seckill=秒杀产品(默认普通产品)
					}).then(res => {
						// this.getData();
						// this.$api.msg('');
						this.storeInfo.userCollect = !this.storeInfo.userCollect
					})
				} else {
					collectAdd({
						id: this.storeInfo.id,
					}).then(res => {
						this.$api.msg('收藏成功');
						this.storeInfo.userCollect = !this.storeInfo.userCollect
					})
				}
			},
			toOnlineStore() {
				// this.seller_info.seller_id
				uni.navigateTo({
					url: `/mall/product/onlineStore?id=${this.seller_info.seller_id}`
				})
			},
			callStore() {
				uni.makePhoneCall({
					phoneNumber: this.seller_info.online_phone
				})
			},
			submit() {
				uni.showLoading({mask:true});
				if (this.btnType == 1) { //买
					cartAdd({
						productId: this.storeInfo.id,
						cartNum: this.goodsNum,
						uniqueId: this.selectDisObj.unique,
						new: 1, //是否购物车购买|0=购物车购买,1=直接购买
					}).then(res => {
						uni.hideLoading()
						uni.navigateTo({
							url: `/mall/enjoyMall/enjoyNo?cartId=${res.data.cartId}`
						})
					})
				} else if (this.btnType == 2) { //加购
					cartAdd({
						productId: this.storeInfo.id,
						cartNum: this.goodsNum,
						uniqueId: this.selectDisObj.unique,
						new: 0,
					}).then(res => {
						uni.hideLoading()
						uni.showToast({
							icon: "none",
							title: "加入购物车成功！"
						})
						this.specClass = 'hide'
					})
				} else if (this.btnType == 3) { //选择确定
					uni.hideLoading()
					this.specClass = 'hide'
				}
			},
			stopPrevent() {},
			previewPic(urls, index) {
				uni.previewImage({
					urls: urls,
					current: index
				})
			},

		},
		onHide() {
			this.specClass = 'none'
		},
	}
</script>

<style lang='scss' scoped>
	.container {
		overflow-x: hidden;
	}

	page {
		overflow-x: hidden;
		background: $page-color-base;
		padding-bottom: 160rpx;
	}

	.cut {
		width: 100%;
		height: 20rpx;
		background: #f5f5f5;
	}

	.cut-10 {
		height: 10rpx;
		background: #f5f5f5;
	}

	.icon-you {
		font-size: $uni-font-size-base + 1rpx;
		color: #666;
	}

	.goBack {
		position: fixed;
		z-index: 998;
		left: 30rpx;
		width: 60rpx;
		height: 60rpx;
		border-radius: 50%;
		background-color: rgba(0, 0, 0, .5);
		text-align: center;
		line-height: 60rpx;

		text {
			margin-right: -8rpx;
			color: #fff;
		}
	}

	.navigation {
		position: fixed;
		top: var(--status-bar-height);
		padding: 0 30rpx;
		height: 100rpx;
		width: 100%;
		box-sizing: border-box;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: inherit;
		z-index: 999999;

		.back {
			width: 60rpx;
			height: 60rpx;
			border-radius: 50%;
			background-color: rgba(0, 0, 0, .5);
			display: flex;
			align-items: center;
			justify-content: center;

			.icon-zuo {
				margin-right: -10rpx;
				color: #fff;
			}
		}

		.right {
			display: flex;

			.a {
				width: 60rpx;
				height: 60rpx;
				border-radius: 50%;
				background-color: rgba(0, 0, 0, .5);
				display: flex;
				align-items: center;
				justify-content: center;
				margin-left: 30rpx;

				image {
					width: 30rpx;
				}
			}

			.b {
				image {
					width: 34rpx;
				}
			}
		}

	}

	.carousel {
		height: 722rpx;
		position: relative;

		swiper {
			height: 100%;
		}

		.image-wrapper {
			width: 100%;
			height: 100%;
		}

		.swiper-item {
			display: flex;
			justify-content: center;
			align-content: center;
			height: 750rpx;
			overflow: hidden;

			image {
				width: 100%;
				height: 100%;
			}
		}

	}

	/* 标题简介 */
	.introduce-section {
		background: #fff;

		.pd-30 {
			padding: 20rpx 30rpx 20rpx 30rpx;

			image {
				width: 70rpx;
				height: 28rpx;
				margin-right: 12rpx;
			}
		}

		.titleBox {
			display: flex;

			.title {
				flex: 1;
				font-weight: bold;
				color: #333333;
				font-size: 32rpx;
				/* height: 50rpx; */
				line-height: 50rpx;
				text-align: justify;

				text {
					font-weight: normal;
					margin-right: 10rpx;
					padding: 5rpx 7rpx;
					background: #F84350;
					border-radius: 8rpx;
					font-size: 24rpx;
					color: #fff;
				}

			}

			.collect {
				width: 140rpx;
				display: flex;
				flex-direction: column;
				align-items: center;

				image {
					margin-top: 10rpx;
					margin-right: 0;
					width: 40rpx;
					height: 40rpx;
				}

				text {
					font-size: 20rpx;
					color: #343434;
					margin-top: 6rpx;
				}
			}
		}


		.black_rate {
			height: 24rpx;
			line-height: 24rpx;
			font-size: 24rpx;
			margin-top: 12rpx;

			text {
				font-weight: bold;
			}
		}

		.price-box {
			display: flex;
			align-items: baseline;
			height: 64rpx;
			padding: 40rpx 0;
			font-size: 26rpx;
			color: $mall-price;

			.shellIcon {
				width: 30rpx;
				height: 20rpx;
				margin-right: 10rpx;
			}

		}

		.vip-price {
			margin-left: 25rpx;

			text {
				color: #333333;
			}

			.v-icon {
				padding: 1rpx 12rpx;
				background: linear-gradient(0deg, #E9CDA3 0%, #D5AD7B 100%);
				border-radius: 20rpx;
				font-weight: bold;
				font-size: 18rpx;
				margin-left: 10rpx;
			}

			.k2 {
				background: #000;
				color: #E5C599;
			}
		}

		.price-tip {
			font-size: 24rpx;
			font-weight: bold;
		}

		.price {
			font-size: 40rpx;
			font-weight: bold;
		}

		.pricePoint {
			font-weight: bold;
			font-size: 30rpx;
		}

		.v-price-tip {
			font-size: 20rpx;
			font-weight: bold;
		}

		.v-price {
			font-size: 28rpx;
			font-weight: bold;
		}

		.v-pricePoint {
			font-weight: bold;
			font-size: 20rpx;
		}

		.m-price {
			margin: 0 12rpx;
			color: $font-color-light;
			text-decoration: line-through;
		}

		.coupon-tip {
			align-items: center;
			padding: 4rpx 10rpx;
			background: $mall-color-pri;
			font-size: $uni-font-size-sm;
			color: #fff;
			border-radius: 6rpx;
			line-height: 1;
			transform: translateY(-4rpx);
		}

		.bot-row {
			padding-right: 30rpx;
			display: flex;
			align-items: center;
			height: 50rpx;
			font-size: 24rpx;
			color: #B4B4B4;
			justify-content: space-between;
			padding-bottom: 25rpx;

			text {
				/* flex: 1;
				text-align: center; */
			}
		}
	}

	/* 分享 */
	.share-section {
		display: flex;
		align-items: center;
		color: $mall-color-base;
		background: linear-gradient(left, #fdf5f6, #fbebf6);
		padding: 12rpx 30rpx;

		.share-icon {
			display: flex;
			align-items: center;
			width: 70rpx;
			height: 30rpx;
			line-height: 1;
			border: 1px solid $mall-color-pri;
			border-radius: 4rpx;
			position: relative;
			overflow: hidden;
			font-size: 22rpx;
			color: $mall-color-pri;

			&:after {
				content: '';
				width: 50rpx;
				height: 50rpx;
				border-radius: 50%;
				left: -20rpx;
				top: -12rpx;
				position: absolute;
				background: $mall-color-pri;
			}
		}

		.icon-xingxing {
			position: relative;
			z-index: 1;
			font-size: 24rpx;
			margin-left: 2rpx;
			margin-right: 10rpx;
			color: #fff;
			line-height: 1;
		}

		.tit {
			font-size: $uni-font-size-base;
			margin-left: 10rpx;
		}

		.icon-bangzhu1 {
			padding: 10rpx;
			font-size: 30rpx;
			line-height: 1;
		}

		.share-btn {
			flex: 1;
			text-align: right;
			font-size: $uni-font-size-sm;
			color: $mall-color-pri;
		}

		.icon-you {
			font-size: $uni-font-size-sm;
			margin-left: 4rpx;
			color: $mall-color-pri;
		}
	}

	.c-list {
		font-size: 24rpx;
		color: #333;
		background: #fff;

		.c-row {
			display: flex;
			align-items: center;
			padding: 30rpx;
			position: relative;
		}

		.b-b {
			border-top: 1px solid #ededed;
		}

		.tit {
			width: 140rpx;
		}

		.con {
			flex: 1;
			color: $font-color-dark;

			.selected-text {
				margin-right: 10rpx;
			}
		}

		.red {
			color: $mall-color-pri;
		}

		.v-icon {
			padding: 1rpx 12rpx;
			background: #000;
			color: #E5C599;
			border-radius: 20rpx;
			font-weight: bold;
			font-size: 18rpx;
			margin-right: 10rpx;
		}
	}

	/* 评价 */
	.eva-section {
		display: flex;
		flex-direction: column;
		padding: 30rpx;
		background: #fff;

		.e-header {
			display: flex;
			align-items: center;
			font-size: $uni-font-size-sm - 2rpx;
			color: $font-color-light;

			.tit {
				font-size: 28rpx;
				color: #333333;
				margin-right: 4rpx;
			}

			.desc {
				font-size: 22rpx;
				color: #666666;

			}

			.tip {
				flex: 1;
				text-align: right;
			}

			.icon-you {
				margin-left: 10rpx;
			}
		}
	}

	.eva-box {
		display: flex;
		padding: 20rpx 0;

		.portrait {
			flex-shrink: 0;
			width: 80rpx;
			height: 80rpx;
			border-radius: 100px;
		}

		.right {
			flex: 1;
			display: flex;
			flex-direction: column;
			font-size: $uni-font-size-base;
			color: $mall-color-base;
			padding-left: 26rpx;

			.con {
				font-size: $uni-font-size-base;
				color: $font-color-dark;
				padding: 20rpx 0;
			}

			.bot {
				display: flex;
				justify-content: space-between;
				font-size: $uni-font-size-sm;
				color: $font-color-light;
			}
		}

		.comment-pics {
			width: 100%;
			display: flex;
			justify-content: space-between;
			padding: 30rpx 0;

			image {
				width: 180rpx;
				height: 180rpx;
				border-radius: 10rpx;

			}
		}
	}

	.shop {
		padding: 40rpx 32rpx;
		position: relative;
		background-color: #fff;

		.shopInfo {
			display: flex;

			image {
				width: 120rpx;
				height: 120rpx;
				border-radius: 8rpx;
			}

			.infoBox {
				display: flex;
				flex-direction: column;
				justify-content: center;
				margin-left: 25rpx;

				.title {
					font-size: 32rpx;
					font-weight: bold;
					color: rgba(51, 51, 51, 1);
					margin-bottom: 28rpx;
					width: 450rpx;

					.icon {
						padding: 0 6rpx;
						height: 36rpx;
						background: #F25656;
						border-radius: 4rpx;
						text-align: center;
						line-height: 36rpx;
						font-size: 24rpx;
						color: #fff;
						margin-right: 10rpx;
					}
				}

				.info__rate {
					.score {
						margin-left: 10rpx;
						font-size: 24rpx;
						font-weight: 500;
						color: #F86436;
					}

					.conclusion {
						margin-left: 10rpx;
						font-size: 24rpx;
						font-weight: 500;
						color: #666666;
					}
				}
			}
		}

		.goto {
			position: absolute;
			top: 40rpx;
			right: 12rpx;
			color: #333333;
		}

		.goodsList {
			margin-top: 40rpx;
			display: flex;
			justify-content: space-between;

			.item {
				display: flex;
				flex-direction: column;
				align-items: center;
				width: 210rpx;

				image {
					width: 210rpx;
					height: 210rpx;
					background: #DEDEDE;
					border-radius: 8rpx;
					margin-bottom: 24rpx;
				}

				text {
					width: 210rpx;
					font-size: 28rpx;
					color: #666666;
				}
			}
		}

		.seeMore {
			margin-top: 30rpx;
			display: flex;
			justify-content: center;

			text {
				width: 180rpx;
				height: 60rpx;
				border: 2rpx solid #DEDEDE;
				border-radius: 30rpx;
				text-align: center;
				line-height: 60rpx;
				font-size: 28rpx;
				color: #9A9A9A;
			}
		}
	}

	/*  详情 */
	.detail-desc {
		background: #fafafa;

		.d-header {
			display: flex;
			justify-content: center;
			align-items: center;
			height: 80rpx;
			font-size: 30rpx;
			color: #333333;
			position: relative;
			font-weight: Medium;
			background-color: #fff;

			.txt {
				padding: 0 20rpx;
				background: #fff;
				position: relative;
				z-index: 1;
			}

			&:after {
				position: absolute;
				left: 50%;
				top: 50%;
				transform: translateX(-50%);
				width: 300rpx;
				height: 0;
				content: '';
				border-bottom: 1px solid #ccc;
			}
		}

		.rich-text {
			width: 100%;
			overflow-x: hidden;

			.img {
				width: 100%;
			}

			image {
				width: 100%;
			}
		}

		.d-footer {
			display: flex;
			justify-content: center;
			align-items: center;
			height: 80rpx;
			font-size: 24rpx;
			color: #9a9a9a;
			position: relative;
			font-weight: Medium;
			background-color: #fafafa;

			.text {
				padding: 0 20rpx;
				background: #fafafa;
				position: relative;
				z-index: 1;
			}

			&:after {
				position: absolute;
				left: 50%;
				top: 50%;
				transform: translateX(-50%);
				width: 300rpx;
				height: 0;
				content: '';
				border-bottom: 1px solid #ccc;
			}
		}
	}

	.goodslist {
		padding-bottom: 110rpx;
		padding-bottom: calc(110rpx + env(safe-area-inset-bottom));

		.goodslistTitle {
			text-align: center;
			height: 100rpx;
			line-height: 100rpx;
			font-size: 30rpx;
			font-weight: bold;
			color: #343434;
		}

		.goodslistBox {
			padding: 20rpx 30rpx 0;
		}
	}

	/* 规格选择弹窗 */
	.attr-content {
		padding: 30rpx;
		box-sizing: border-box;

		.a-c {
			position: absolute;
			top: 150rpx;
			bottom: 210rpx;
			bottom: calc(210rpx + env(safe-area-inset-bottom));
			overflow-y: scroll;
		}

		.a-t {
			display: flex;

			image {
				background-color: #f5f5f5;
				width: 170rpx;
				height: 170rpx;
				flex-shrink: 0;
				margin-top: -70rpx;
				border-radius: 8rpx;
			}

			.right {
				display: flex;
				flex-direction: column;
				padding-left: 24rpx;
				font-size: 20rpx;
				color: #999;
				line-height: 30rpx;

				.price {
					line-height: 40rpx;
					font-weight: bold;
					font-size: $uni-font-size-lg;
					color: $mall-price;

					&:before {
						content: '￥';
						font-size: 20rpx;
					}
				}
			}
		}

		.num {
			position: absolute;
			left: 0;
			bottom: 120rpx;
			bottom: calc(120rpx + env(safe-area-inset-bottom));
			height: 100rpx;
			width: 100%;
			padding: 0 30rpx;
			box-sizing: border-box;
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 26rpx;

			.uni-number-box {
				width: 200rpx;
				height: 50rpx;
				position: relative;
			}
		}

		.btn-box {
			position: absolute;
			left: 0;
			bottom: 0;
			width: 100%;
			border-top: 1px solid #eee;
			z-index: 99;
			height: 119rpx;
			padding-bottom: env(safe-area-inset-bottom);
			display: flex;
			align-items: center;

			.btn {
				height: 76rpx;
				line-height: 76rpx;
				border-radius: 38rpx;
				background: $mall-price;
				font-size: 28rpx;
				color: #fff;
				width: 690rpx;
			}
		}

		.attr-list {
			padding-top: 30rpx;

			.specTitle {
				font-size: 28rpx;
				color: #999;
			}

			.itemBox {
				margin-top: 30rpx;
				display: flex;
				flex-wrap: wrap;

				.item {
					font-size: 24rpx;
					height: 50rpx;
					line-height: 50rpx;
					text-align: center;
					color: #999;
					border: 1rpx solid #999;
					margin-right: 30rpx;
					padding: 0 30rpx;
					border-radius: 25rpx;
					margin-bottom: 30rpx;
				}

				.itemAct {
					background-color: $mall-price;
					border: 1rpx solid $mall-price;
					color: #fff;
				}
			}
		}

	}

	/*  弹出层 */
	.popup {
		position: fixed;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 99;

		&.show {
			display: block;

			.mask {
				animation: showPopup 0.2s linear both;
			}

			.layer {
				animation: showLayer 0.2s linear both;
			}
		}

		&.hide {
			animation: hideLayer 0.2s linear both;

			.mask {
				animation: hideLayer 0.2s linear both;
			}

			.layer {
				animation: hideLayer 0.2s linear both;
			}
		}

		&.none {
			display: none;
		}

		.mask {
			position: fixed;
			top: 0;
			width: 100%;
			height: 100%;
			z-index: 1;
			background-color: rgba(0, 0, 0, 0.4);
		}

		.layer {
			position: fixed;
			z-index: 99;
			bottom: 0;
			padding-bottom: env(safe-area-inset-bottom);
			width: 100%;
			height: 70vh;
			border-radius: 10rpx 10rpx 0 0;
			background-color: #fff;
		}

		@keyframes showPopup {
			0% {
				opacity: 0;
			}

			100% {
				opacity: 1;
			}
		}

		@keyframes hidePopup {
			0% {
				opacity: 1;
			}

			100% {
				opacity: 0;
			}
		}

		@keyframes showLayer {
			0% {
				transform: translateY(120%);
			}

			100% {
				transform: translateY(0%);
			}
		}

		@keyframes hideLayer {
			0% {
				transform: translateY(0);
			}

			100% {
				transform: translateY(120%);
			}
		}
	}

	/* 底部操作菜单 */
	.page-bottom {
		position: fixed;
		bottom: 0;
		left: 0;
		padding-bottom: env(safe-area-inset-bottom);
		z-index: 95;
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		height: 110rpx;
		padding: 0 30rpx;
		box-sizing: border-box;
		background: #fff;
		box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, .1);

		.left {
			display: flex;
			align-items: center;

			.p-b-btn {
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				font-size: 18rpx;
				color: rgba(51, 51, 51, 1);
				width: 110rpx;
				height: 80rpx;
				margin-right: 10rpxs;

				image {
					width: 40rpx;
					height: 40rpx;
					margin-bottom: 5rpx;
				}

				.active {
					color: $mall-price;
				}
			}
		}


		.action-btn-group {
			display: flex;
			justify-content: flex-end;
			line-height: 70rpx;
			text-align: center;
			color: #fff;
			font-size: 26rpx;
			flex: 1;

			.add-cart-btn {
				width: 222rpx;
				height: 70rpx;
				background: linear-gradient(90deg, #EF9C2F 0%, #F8B015 100%);
				border-radius: 35rpx;
				margin-right: 24rpx;
			}

			.buy-now-btn {
				width: 200rpx;
				height: 70rpx;
				background: linear-gradient(90deg, #FB3838 0%, #FD5353 100%);
				border-radius: 35rpx;
			}
		}
	}

	.backTop {
		position: fixed;
		bottom: 254rpx;
		bottom: calc(254rpx + env(safe-area-inset-bottom));
		right: 30rpx;
		width: 80rpx;
		height: 80rpx;
		background: #FFFFFF;
		border: 1rpx solid #EEEEEE;
		border-radius: 50%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;

		image {
			width: 30rpx;
		}

		text {
			font-size: 20rpx;
			font-weight: 500;
			color: #666666;
		}
	}
</style>
